package com.java.gui;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

public class BroderLayoutTest {
	public static void main(String[] args) {
		JFrame jf=new JFrame("边框布局");
		jf.setLayout(new BorderLayout());
//		for(int i=0;i<10;i++){
//			jf.add(new JButton("Button_"+i));
//			
//		}
		jf.add(new JButton("东"),BorderLayout.EAST);
		jf.add(new JButton("南"),BorderLayout.SOUTH);
		jf.add(new JButton("西"),BorderLayout.WEST);
		jf.add(new JButton("北"),BorderLayout.NORTH);
		jf.add(new JButton("中"),BorderLayout.CENTER);
		
		jf.setSize(400, 300);
		jf.setVisible(true);
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

}
